<h1><?php echo $project['name']?></h1>
<form action="/project/<?php echo $project['id']?>/submit_setting/" method="post" accept-charset="utf-8" class="fancy-form">
	<div class="str-setting box-skin">
		<div class="wrap-title">
			<h1>Project setting</h1>
		</div>
		<div class="wrap-project">
			<div class="set-ele"> 
				<div class="left-collum"><strong>Project name:</strong> </div>
				<div class="right-collum"><input name="name" value="<?php echo $project['name']?>"></div>
			</div>
			<div class="set-ele"> 
				<div class="left-collum"><strong>Project Description:</strong> </div>
				<div class="right-collum"><textarea name="description"><?php echo $project['description']?></textarea></div>
			</div>
			<div class="set-ele"> 
				<div class="left-collum"><strong>Category:</strong> </div>
				<div class="right-collum">
					<input type="text" name="type_name" class="type small topic" value="<?php echo $project['category_name']?>">
					<input type="hidden" name="category" class="category" value="<?php echo $project['category_name']?>">
					<input type="hidden" name="category_id"  name="type" class="type_id js" value=<?php echo $project['category_id']?>">
				</div>
			</div>
			<div class="set-ele"> 
				<div class="left-collum"><strong>Priority:</strong> </div>
				<div class="right-collum">
					<select name="priority">
						<option <?php if ($project['priority'] == Helper_MyConst::PRIORITY_HIGH) echo "selected"?> value="<?php echo Helper_MyConst::PRIORITY_HIGH?>">High</option>
						<option <?php if ($project['priority'] == Helper_MyConst::PRIORITY_MEDIUM) echo "selected"?> value="<?php echo Helper_MyConst::PRIORITY_MEDIUM?>">Medium</option>
						<option <?php if ($project['priority'] == Helper_MyConst::PRIORITY_LOW) echo "selected"?>value="<?php echo Helper_MyConst::PRIORITY_LOW?>">Low</option>
					</select>
				</div>
			</div>
			<div class="set-ele"> 
				<div class="left-collum"><strong>Deadline:</strong> </div>
				<div class="right-collum">
					<input type="text" value="<?php echo $project['deadline']?>" name="deadline" class="deadline small">
				</div>
			</div>
			<div class="set-ele">
				<div class="mid-collum">
					<button class="button" name="save" type="submit">Save</button>
					<button class="button" name="save" type="submit">Cancel</button>
				</div> 
			</div>
		</div>
	</div>	
</form>

<script type="text/javascript">
	$(document).ready(function(){
		$('input#deadline	').datepicker({
			showOn: "button",
			changeMonth : true,
			dateFormat: 'yy-mm-dd',
			timeFormat: 'hh-mm-ss'
		});
		$( ".type" ).autocomplete({
			source: '/ajax_project/get_suggest_type'
		});
		$( ".type" ).bind( "autocompleteselect", function(event, ui) {
			var hidden_input = $(this).parent().find('input.type_id.js');
			console.log(hidden_input);
			hidden_input.val(ui.item.id);
		});
	});
	$('div.sub_bar a').click(function(event){
		event.preventDefault();
		var ele = $(this).parent().children('div.sliding').children('ul');
		if (ele.css('display') == 'none')
			//ele.css('display', 'block');
			ele.fadeIn('slow');
		else
			ele.fadeOut('slow');
		return false;
	});

</script>
